import java.util.Iterator;


public class Test {

	public static void main(String[] args) throws TwoStacks.StackColissionException{
		int n = 50;
		TwoStacks s = new TwoStacks(n);
		TwoStacks.ForwardIterator Stack1;
		Iterator<Object> Stack2; 

		for(int i=0;i<n/2;i++){
				s.pushOne(i);
				s.pushTwo(i);		
		}
		Stack1 = s.ForwardIterator();
		while(Stack1.hasNext())
			System.out.print(Stack1.next()+"\t");
		Stack2 = s.BackwardIterator();
		System.out.println();
		while(Stack2.hasNext())
			System.out.print(Stack2.next()+ "\t");
	}

}
